# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=crackmapexec
_pyver=3.13
pkgver=v6.0.1.r198.gda472cb
pkgrel=5
epoch=3
groups=('blackarch' 'blackarch-scanner' 'blackarch-exploitation'
        'blackarch-windows')
pkgdesc='A swiss army knife for pentesting Windows/Active Directory environments.'
arch=('any')
url='https://github.com/byt3bl33d3r/CrackMapExec'
license=('BSD')
depends=('netexec')
makedepends=()

package() {
  install -dm 755 "$pkgdir/usr/bin"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
echo "CrackMapExec is deprecated and has been replaced by NetExec."
echo "This binary is just an alias for netexec command."
exec netexec "\$@"
EOF

  cat > "$pkgdir/usr/bin/cme" << EOF
#!/bin/sh
echo "CrackMapExec is deprecated and has been replaced by NetExec."
echo "This binary is just an alias for nxc command."
exec nxc "\$@"
EOF

  cat > "$pkgdir/usr/bin/cmedb" << EOF
#!/bin/sh
echo "CrackMapExec is deprecated and has been replaced by NetExec."
echo "This binary is just an alias for nxcdb command."
exec nxcdb "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/bin/cme" \
    "$pkgdir/usr/bin/cmedb"
}

